package com.csy.admin.web;

import com.csy.admin.entity.SysUser;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 类名:通用控制类
 * 用于获取登陆用户信息
 * Created by CSY on 2018/9/10.
 */
public class AbstractController {
    protected Logger logger = LoggerFactory.getLogger(getClass());

    protected SysUser getUser() {
        Object object= SecurityUtils.getSubject().getPrincipal();
        return (SysUser) SecurityUtils.getSubject().getPrincipal();
    }

    protected Long getUserId() {
        return getUser().getUserId();
    }
}
